package cn.mntool.ftp;

import cn.mntool.ftp.core.FtpConfig;
import cn.mntool.ftp.core.SftpManagerSupport;
import cn.mntool.ftp.exception.UploadException;
import com.jcraft.jsch.JSchException;

/**
 * describe:
 *
 * @author lianying
 * @date 2018/12/13
 */
public class Test {
    public static void main(String[] args) {
        String userName = "1";
        String passWord = "1";
        String host = "1";
        int port = 22;
        //设置超时时间10秒
        int timeOut = 10000;
        FtpConfig ftpConfig = new FtpConfig(userName, passWord, host, port, timeOut);
        SftpManagerSupport sftpManagerSupport = new SftpManagerSupport(ftpConfig);
        try {
            sftpManagerSupport.login();
        } catch (JSchException e) {
            e.printStackTrace();
        }
        sftpManagerSupport.delete("/home/testFtp/1");
        sftpManagerSupport.logOut();
    }
}
